<%--
  Created by IntelliJ IDEA.
  User: ChadZhao
  Date: 12-2-12
  Time: 下午7:36
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>音视频分集审核列表</title>

    <style type="text/css">
        <!--
        .tr0 { }

        .tr1 { background-color: #f4f4f4; }

        body,td,th {
            font-size: 14px;
            color: #666666;
        }
        .form { width:99%; padding:5px;}
        .form th { text-align:right; font-weight:bold; padding:5px;}
        .form td { text-align:left; padding:5px;}
        .listinput { border:1px solid #ccc; padding:3px; background-image:url(<c:url value='/images/listinputbg.gif'/>); width:200px;height:24px;}
        .select1  { border:1px solid #ccc; padding:3px;}
        .button { background-image:url(<c:url value='/images/butbg.gif'/>); height:30px; line-height:30px; color:#FFFFFF; font-weight:bold; border:0px; cursor:hand;}
        a:link { font-size: 12px; color: #333333; text-decoration: none; font-family: "微软雅黑";}
        a:visited{ font-size: 12px; color: #333333; text-decoration: none; font-family: "微软雅黑";}
        a:hover {color:#666666; font-family: "微软雅黑";}
        -->
    </style>
</head>
<body onload="parent._setHeight()">
<form method="post">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div style='float:left'> <img height="14" src="<c:url value='/frame/book1.gif'/>" width="20" />&nbsp;音视频分集审核列表 </div>
      <div style='float:right;padding-right:8px;'>
        <!--  //保留接口  -->
      </div></td>
  </tr>
  <tr>
    <td style="font-size:14pt;color:#3e3e3e;text-align: center;"><s:property value="articleTitle"/></td>
  </tr>
  <tr>
    <td height="1" background="<c:url value='/frame/sp_bg.gif'/>" style='padding:0px'></td>
  </tr>
  <tr>
    <td style="font-size:10.5pt;color:#3e3e3e;text-indent: 23px;"><s:property value="summary"/></td>
  </tr>
</table>
    <table width="98%" align="center" border="0" cellpadding="5" cellspacing="1" style="margin-bottom:8px;margin-top:8px;">
  <tr bgcolor="#FFFFFF">
    <td align="center"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
        <tr align="center" style="background-image:url(<c:url value='/frame/lititbg_06.jpg'/>) ">
            <%--<th height="29" width="60" nowrap>选择</th>--%>
            <th height="29" nowrap>标题</th>
            <th width="100" nowrap>发布时间</th>
            <th width="100" nowrap>类型</th>
            <th width="100" nowrap>发布人</th>
            <th width="100" nowrap>状态</th>
            <th width="100" nowrap>操作</th>
        </tr>
       <s:iterator value="%{pageVO.dataList}" id="dl" status="num">
      <tr class='tr<s:property value="#num.index%2"/>' onMouseMove="javascript:this.bgColor='#ddf5d4';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
        <%--<td height="29" align="center"><input type="checkbox" name="choiceBox" value="<s:property value="#dl.DETAILID"/>"/></td>--%>
        <td align="left" height="29">
                <a href="<c:url value='/viewVideoDetailInfo.do?detailId='/><s:property value="#dl.DETAILID"/>&partType=<s:property value="partType"/>" target="_blank" style="color:#0000FF;"><s:property value="#dl.TITLE"/></a></td>
        <td align="center"><s:property value="#dl.INSERTDATE"/></td>
        <td align="center"><s:if test="#dl.VIDEOAUDIOFLAG==\"1\"">视频</s:if><s:elseif test="#dl.VIDEOAUDIOFLAG==\"2\"">音频</s:elseif></td>
        <td align="center"><s:property value="#dl.USERNAME"/></td>
        <td align="center"><s:if test="#dl.STATUS==\"0\"">待审核</s:if><s:elseif test="#dl.STATUS==\"1\"">审核通过</s:elseif><s:elseif test="#dl.STATUS==\"2\"">审核未通过</s:elseif> </td>
        <td align="center">
                <s:if test="#dl.STATUS==\"0\""><a href="<c:url value='/system/editVideoDetailInfo.do?dataType=2&detailId='/><s:property value="#dl.DETAILID"/>&articleId=<s:property value="articleId"/>&partType=<s:property value="partType"/>">审核</a></s:if>
                <a href="#" onclick="doDelVideo('<s:property value="#dl.DETAILID"/>','<s:property value="#dl.VIDEOAUDIOFLAG"/>')">删除</a>
          </td>
      </tr>
    </s:iterator>
        <tr style="height:26px;font-size: 12px;">
            <td style="padding-left:6px;text-align: left;" colspan="3">
                <%--<button type="button" class="button" style="width:50px;" onclick="checkAll()">全选</button>--%>
                <%--&nbsp;--%>
                <%--<button type="button" class="button" style="width:50px;" onclick="nocheck()">反选</button>--%>
                <%--&nbsp;--%>
                <%--<button type="button" class="button" onClick="passCheck()">审核通过</button>--%>
                <%--&nbsp;--%>
                <%--<button type="button" class="button" onClick="noPassCheck()">审核不通过</button>--%>
                <%--&nbsp;--%>
                <button type="button" class="button" style="width:50px;" onclick="location.href='<c:url value='/system/toCheckVideoList.do'/>'">返回</button>
            </td>
            <td colspan="4" style="padding-right:6px;text-align: right;">
                共<s:property value="%{pageVO.totalCount}"/>条
                共<s:property value="%{pageVO.totalPage}"/>页
                第<s:property value="%{pageVO.currentPage}"/>页
                <s:if test="%{pageVO.currentPage > 1}">
                    <a href="#" onclick='toPage(1);return false;'>[首页]</a>
                    <a href="#"
                       onclick='toPage(<s:property value="pageVO.priviousPage"/>);return false'>[上一页]</a>
                </s:if>
                <s:if test="%{pageVO.totalPage > pageVO.currentPage}">
                    <a href="#" onclick='toPage(<s:property value="pageVO.nextPage"/>);return false;'>[下一页]</a>
                    <a href="#" onclick='toPage(<s:property value="pageVO.totalPage"/>);return false;'>[尾页]</a>
                </s:if>
                <input name="goPage" type="text" class="listinput" style="width:28px;" size="1"/>&nbsp;
                <button type="button" class="button" style="width:32px;" onClick="jumpToPage()">GO</button>
                &nbsp;
            </td>
        </tr>
    </table>
            </td>
        </tr>
    </table>
    <s:hidden name="articleId"/>
    <s:hidden name="partType"/>
    </form>
</body>
<script>
    parent._setHeight();

    function toPage(pageNum) {
        document.forms[0].action = "<c:url value='/system/toCheckVideoDetailList.do?targerPageNum='/>"+ pageNum;
        document.forms[0].submit();
    }

    function jumpToPage() {
        var iForm = document.forms[0];
        if (iForm.goPage.value == "") {
            alert("请输入要跳转到的页数！");
            return;
        }
        if (isNaN(iForm.goPage.value)) {
            alert("页数只能为整数！");
            return;
        }
        var toPageNum = parseInt(iForm.goPage.value);
        if (toPageNum < 1 || toPageNum > <s:if test="%{pageVO.totalPage != null}"><s:property value="%{pageVO.totalPage}"/></s:if><s:else>1</s:else>) {
            alert("页数输入有误！");
            return;
        }
        toPage(toPageNum);
    }

    function doDelVideo(theid,thevflag){
        var mess = "您确定删除这部视频吗？";
        if(thevflag=="2") mess = "您确定删除这部音频吗？";
        if(!confirm(mess)){
            return;
        }
        document.forms[0].action="<c:url value='/system/delVideoDetailInfo.do?targerPageNum=1&dataType=2&detailId='/>"+theid;
        document.forms[0].submit();
    }

    function passCheck(){
        var haveCheck=false;
        if (document.all.choiceBox) {
             if (document.all.choiceBox.length) {
                for (var a = 0; a < document.all.choiceBox.length; a ++) {
                     if (document.all.choiceBox[a].checked) {
                           haveCheck=true;
                     }
                }
             } else {
                 if (document.all.choiceBox.checked) {
                      haveCheck=true;
                 }
             }
        } else {
            alert("没有可以审核的视频！");
            return;
        }
        if(!haveCheck){
            alert("请选择需要审核的视频！");
            return;
        }
        if(!confirm("您确定通过这些视频的审核吗？")){
            return;
        }
        document.forms[0].action="<c:url value='/system/doCheckVideos.do?checkFlag=1'/>";
        document.forms[0].submit();
    }

    function noPassCheck(){
        var haveCheck=false;
        if (document.all.choiceBox) {
             if (document.all.choiceBox.length) {
                for (var a = 0; a < document.all.choiceBox.length; a ++) {
                     if (document.all.choiceBox[a].checked) {
                           haveCheck=true;
                     }
                }
             } else {
                 if (document.all.choiceBox.checked) {
                      haveCheck=true;
                 }
             }
        } else {
            alert("没有可以审核的视频！");
            return;
        }
        if(!haveCheck){
            alert("请选择需要审核的视频！");
            return;
        }
        if(!confirm("您确定不通过这些视频的审核吗？")){
            return;
        }
        document.forms[0].action="<c:url value='/system/doCheckVideos.do?checkFlag=2'/>";
        document.forms[0].submit();
    }

    function checkAll() {
        if (document.all.choiceBox) {
            if (document.all.choiceBox.length) {
                for (var a = 0; a < document.all.choiceBox.length; a ++) {
                    document.all.choiceBox[a].checked = true;
                }
            } else {
                document.all.choiceBox.checked = true;
            }
        }
    }

    function nocheck() {
        if (document.all.choiceBox) {
            if (document.all.choiceBox.length) {
                for (var a = 0; a < document.all.choiceBox.length; a ++) {
                    if (document.all.choiceBox[a].checked) {
                        document.all.choiceBox[a].checked = false;
                    } else {
                        document.all.choiceBox[a].checked = true;
                    }

                }
            } else {
                if (document.all.choiceBox.checked) {
                    document.all.choiceBox.checked = false;
                } else {
                    document.all.choiceBox.checked = true;
                }
            }
        }
    }
</script>
</html>